package com.qd.common.panda.domain.entity.carpark;

import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.DeleteGroup;
import com.cdqidi.valid.group.UpdateGroup;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.JsonNode;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;


/**
 * 免费停车设置
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
public class CarParkChargeFeeDTO extends BaseQuery {

    /**
     * 主键
     */
    @NotBlank(message = "设置ID不能为空", groups = {DeleteGroup.class, UpdateGroup.class})
    @Size(max = 50, message = "设置ID长度不能超过{max}位", groups = {DeleteGroup.class, UpdateGroup.class})
    private String sid;
    /**
     * 说明
     */
    @NotBlank(message = "说明不能为空", groups = DefaultGroup.class)
    @Size(max = 200, message = "说明长度不能超过{max}位", groups = DefaultGroup.class)
    private String note;
    /**
     * 规则
     */
    private JsonNode rule;
    /**
     * 停车场标识
     */
    @Size(max = 50, message = "停车场标识长度不能超过{max}位", groups = DefaultGroup.class)
    @JsonProperty("pId")
    private String pId;
    /**
     * 充电免费停车时段
     */
    @NotBlank(message = "充电免费停车时段不能为空", groups = DefaultGroup.class)
    @Size(max = 20, message = "充电免费停车时段长度不能超过{max}位", groups = DefaultGroup.class)
    private String feeTimeId;

    @Override
    public void freeData() {
        this.sid = null;
        this.note = null;
        this.rule = null;
        this.pId = null;
        this.feeTimeId = null;
        super.freeData();
    }
}
